<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>

<html:html>

<head>
	<title><bean:message key="ListeStagesEntreprise.titre"/></title>
	<link rel="stylesheet"  type="text/css" href="<%=request.getContextPath()%>/style/skeleton.css" /> 
	<link rel="stylesheet"  type="text/css" href="<%=request.getContextPath()%>/style/main.css" /> 
</head>

<body class="container">
	<logic:empty name="ENTREPRISE">
		<logic:redirect action="/DeconnexionEntreprise.do"/>
	</logic:empty>
	
	<center>
		<h1>
			<bean:message key="Entreprise.text.heder"/>
		</h1>
	</center>
	
	<ul id="menu">
			<li>
				<html:link action="/RetourAccueilEntreprise.do"><bean:message key="Entreprise.Guidage.LienAcceuil"/></html:link>
			</li>
			<li>
				<html:link action="/ProposerStage.do"><bean:message key="Entreprise.Guidage.LienProposerStage"/></html:link>
			</li>
			<li>
				<html:link action="/ListerStagesEntreprise.do"><bean:message key="Entreprise.Guidage.LienListeStages"/></html:link>
			</li>
			<li>
				<html:link action="/DeconnexionEntreprise.do"><bean:message key="Entreprise.Guidage.LienDeconnexion"/></html:link>
			</li>
	</ul>
	

		<h3><bean:message key="ListeStagesEntreprise.listestage"/></h3>
		<table class="grid">
			<thead>
				<tr>
					<th><bean:message key="ListeStagesEntreprise.idstage"/></th>
					<th><bean:message key="ListeStagesEntreprise.intitule"/></th>
					<th><bean:message key="ListeStagesEntreprise.lieu"/></th>
					<th><bean:message key="ListeStagesEntreprise.debut" /></th>
					<th><bean:message key="ListeStagesEntreprise.fin"/></th>
					<th><bean:message key="ListeStagesEntreprise.description"/></th>
					<th><bean:message key="ListeStagesEntreprise.departement"/></th>
					<th><bean:message key="ListeStagesEntreprise.statut"/></th>
					<th><bean:message key="ListeStagesEntreprise.candidatures"/></th>			
				</tr>
			</thead>
			<logic:iterate id="stage" name="LISTESTAGE" scope="session">
				<bean:size id="nbcandidature"  name="stage" property="listeCandidatures"/>
				<tr>
					<td><bean:write name="stage" property="idStage"/></td>
					<td>
						<logic:equal name="nbcandidature" value="0">
							<bean:write name="stage" property="intitule"/>
						</logic:equal>
						
						<logic:greaterThan name="nbcandidature" value="0">
							<html:link action="/listerCandidatures.do" paramId="idStage" paramName="stage" paramProperty="idStage">
								<bean:write name="stage" property="intitule"/>
							</html:link>
						</logic:greaterThan>
					</td>
					<td><bean:write name="stage" property="lieu"/></td>
					<td><bean:write name="stage" property="debut" format="dd/MM/yyyy" /></td>
					<td><bean:write name="stage" property="fin" format="dd/MM/yyyy" /></td>
					<td><bean:write name="stage" property="description"/></td>
					<td><bean:write name="stage" property="departement.libelle"/></td>
					<td>
						<logic:empty name="stage" property="validationDepartement">
							 <bean:message key="ListeStagesEntreprise.symbolestagenonvalide"/>
						</logic:empty>
						
						<logic:notEmpty name="stage" property="validationDepartement">
							<bean:message key="ListeStagesEntreprise.symbolestagevalide"/>
						</logic:notEmpty>
					</td>
					<td>
						<bean:write name="nbcandidature"/>
					</td>			
				</tr>
			</logic:iterate>
		</table>	
	
	<div id="messages" style="margin-top:50px;">
		<table>
			<tr>
				<td>
					<font color="red">
						<bean:message key="ListeStagesEntreprise.symbolestagenonvalide"/>
					</font>
				</td>
				<td>
					<bean:message key="ListeStagesEntreprise.stagenonvalide"/>
				</td>
			</tr>
			
			<tr>
				<td>
					<font color="green">
						<bean:message key="ListeStagesEntreprise.symbolestagevalide"/>
					</font>
				</td>
				<td>
					<bean:message key="ListeStagesEntreprise.stagevalide"/>
				</td>
			</tr>
		</table>
		
		<table>
			<tr>
				<td>
					<bean:message key="ListeStagesEntreprise.messageconsultercandidature"/>
				</td>
			</tr>
			<tr>
				<td>
					<bean:message key="ListeStagesEntreprise.messagelienvide"/>
				</td>
			</tr>
		</table>
		
		<font color="red">
			<br>
			<html:errors/>
			<logic:notEmpty name="message_candidature_valider" >
					<bean:message name="message_candidature_valider"/>
			</logic:notEmpty>
		</font>
	</div>
	
	<div style="margin-top:100px;">
		<hr/>
		<center>
			<font size="3" color="#000080">
				<bean:message key="Entreprise.text.footer"/>
			</font>
		</center>
	</div>
	
</body>

</html:html>